home *** CD-ROM | disk | FTP | other *** search
- #include <exec/types.h>
- #include <exec/libraries.h>
- #include <dos/dos.h>
- #include <clib/exec_protos.h>
- #include <clib/dos_protos.h>
-
- #include <stdio.h>
-
- #include "global.h"
- #include "break.h"
- #include "load.h"
-
- /*
- ** Load the specified library
- */
- void LoadLib(STRPTR LibName, BOOL Report)
- {
- struct Library *Library;
-
- Library = OldOpenLibrary(LibName);
- if (Library)
- {
- printf("%s v%d.%d loaded.\n",LibName,
- Library->lib_Version,
- Library->lib_Revision);
- CloseLibrary(Library);
- }
- else if (Report)
- fprintf(stderr,"Couldn't open %s.\n",LibName);
- }
-
- /*
- ** Load all libraries in the LIBS: assignment
- */
- void LoadLibs(void)
- {
- BPTR LibsLock;
- struct FileInfoBlock LibsFIB;
-
- LibsLock = Lock("LIBS:",SHARED_LOCK);
- if (!LibsLock)
- fputs("LIBS: is not available!\n",stderr);
- else
- {
- Examine(LibsLock,&LibsFIB);
-
- while (ExNext(LibsLock,&LibsFIB))
- {
- LoadLib(LibsFIB.fib_FileName,QUIET);
- if (CTRL_C)
- {
- fputs(BREAK_TXT,stderr);
- break;
- }
- }
-
- UnLock(LibsLock);
- }
- }
-